﻿<%@ Page Title="" Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" EnableViewState="false" EnableViewStateMac="false" CodeBehind="category_default.aspx.cs" Inherits="Icst.Leaflike.Web.category._default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="server">
    <div style="margin-top:10px;">
        <table cellpadding="0" cellspacing="0">
            <tr>
                <td valign="top" style="width:120px">
                    <div class="sw_menu"">
                        <h2>索引/对照表</h2>
                        <ul>
                            <li><a href='<%="category_default.htm?sort=1&"%>'><strong>按字典排序</strong></a></li>
                            <li><a href="category_dictionary.htm"><strong>名词、俗语对照表</strong></a></li>
                        </ul>
                     </div>
                </td>
                <td valign="top">
                    <form id="Form1" runat="server">
                        <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />
                        <table>
                            <tr><td style="width:100px">门:</td> <td><asp:DropDownList ID="phylum" runat="server" Width="200"/></td>
                            <td>纲: </td><td><asp:DropDownList ID="classid" runat="server" Width="200"/></td></tr>
                            <tr><td>属: </td><td><asp:DropDownList ID="family" runat="server" Width="200"/></td>
                            <td>种: </td><td><asp:DropDownList ID="genus" runat="server" Width="200"/></td></tr>
                            <tr><td>关键词: </td><td><asp:TextBox ID="txtSearch" runat="server"  Width="200"/></td>
                            <td /><td><asp:Button class="button_blue r5px" ID="btnSearch" runat="server" Text="搜索" OnClientClick="search_by_category();return false;" /></td></tr>
                        </table>
                        <ajaxToolkit:AutoCompleteExtender runat="server" ID="autoCompletetxtSearch" TargetControlID="txtSearch" ServiceMethod="GetNames" ServicePath="categories.asmx" MinimumPrefixLength="1"  CompletionInterval="1000" EnableCaching="true" CompletionSetCount="20" CompletionListCssClass="autocomplete_completionListElement"  CompletionListItemCssClass="autocomplete_listItem"  CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompletionListItem="true" />
                        <ajaxToolkit:CascadingDropDown ID="phylumCascade" runat="server" TargetControlID="phylum" Category="phylum" PromptText="不限" ServicePath="categories.asmx" ServiceMethod="Getphylums" />
                        <ajaxToolkit:CascadingDropDown ID="classidCascade" runat="server" TargetControlID="classid" ParentControlID="phylum" PromptText="不限" ServiceMethod="Getclasses" ServicePath="categories.asmx" Category="classid" />
                        <ajaxToolkit:CascadingDropDown ID="familyCascade" runat="server" TargetControlID="family" ParentControlID="classid" PromptText="不限" ServiceMethod="Getfamilies" ServicePath="categories.asmx" Category="family" />
                        <ajaxToolkit:CascadingDropDown ID="genusCascade" runat="server" TargetControlID="genus" ParentControlID="family" PromptText="不限" ServiceMethod="Getgenuses" ServicePath="categories.asmx" Category="genus" />
                    </form>
                    <%
                        if (_categories != null)
                        {
                            foreach (Icst.Leaflike.Data.tree_search_bycategoryResult r in _categories)
                            {
                     %>
                           <table cellspacing="0" cellpadding="2" style="margin-bottom:5px">
                                <tr>
                                    <td class="thumbnail" valign="top">
                                        <a href='<%="trees/"+r.imagelink %>' mon="a=5&pn=3" target="_blank"><img src='<%="thumbnail.htm?thumbnail=true&name="+r.imagelink %>' border="1" /></a>
                                    </td>
                                    <td class="text" valign="top">
                                        <a href='<%="tree.htm?id="+r.tree_no %>' mon="a=5&pn=3" target="_blank"><span><b><%=r.tree_name%></b></span></a>
                                        <br />
                                        <font size="-1"><%=this.Server.HtmlEncode(r.description)%></font>
                                        <br />
                                        <a href='<%="search_relevant.htm?tree="+r.tree_no %>' mon="a=5&pn=3" target="_blank"><span><b>相关</b></span></a>
                                        <a href='<%="search_similar.htm?tree="+r.tree_no %>' mon="a=5&pn=3" target="_blank"><span><b>相似</b></span></a>
                                        <%if (r.Links.Count > 0)
                                          { %>
                                        <br />
                                        <%foreach (var link in r.Links)
                                          {%>
                                          <a href='<%=link.Value %>' mon="a=5&pn=3" target="_blank"><span><b><%=link.Key%></b></span></a>
                                        <%} %>
                                        <%} %>
                                    </td>
                                </tr>
                            </table>
                    <%}
                        }%>
                    <asp:Paginator runat="server"  ID="paginator" ShowGotoBox="false"  ShowFirstPage="false" ShowLastPage="false" ShowPageIndexList="false"
                     PageSize="10" PagerTagName="span" PagerCssClass="num_btn" NumericButtonCount="10" CustomizeTextAlign="Left" CssClass="pager" PageListCssClass="page_list" />
               </td>
            </tr>
        </table>
   </div>
   <script type="text/javascript">
       var phylum_id = "<%=phylum.ClientID %>";
       var classid_id = "<%=classid.ClientID %>";
       var family_id = "<%=family.ClientID %>";
       var genus_id = "<%=genus.ClientID %>";
       var txtSearch_id = "<%=txtSearch.ClientID %>";
       function search_by_category() {
           var phylum = document.getElementById(phylum_id).value;
           var classid = document.getElementById(classid_id).value;
           var family = document.getElementById(family_id).value;
           var genus = document.getElementById(genus_id).value;
           var txtSearch = document.getElementById(txtSearch_id).value;

           window.location.href = "category_default.htm?phylum=" + phylum + "&classid=" + classid + "&family=" + family + "&genus=" + genus + "&keyword=" + txtSearch;
       }
   </script>
</asp:Content>
